<html>
	<head>
		<meta charset="utf-8"></meta>
		<title>BMenuBar</title>
		<link href="./style.css" rel="stylesheet" type="text/css"/>
	</head>
	<body>
		<div class="class" name="BMenuBar">
			<h1>BMenuBar</h1>
			<p>继承自<a href="BWidget.html">BWidget</a></p>
			<p id="resume">BMenuBar是菜单栏控件，用于管理若干菜单项，显示菜单的图标和文本。<a href="#desc">详细</a></p><h2>public</h2>
			<table id="public">
				<tr><td align="right"/><td><a href="#BMenuBar(BWidget*)">BMenuBar</a>(BWidget* parent = 0);</td></tr>
				<tr><td align="right"/><td><a href="#~BMenuBar()">~BMenuBar</a>();</td></tr>
				<tr><td align="right">virtual const BString&amp; </td><td><a href="#realTips() const">realTips</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setAlign(Align)">setAlign</a>(Align align);</td></tr>
				<tr><td align="right">Align </td><td><a href="#align() const">align</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setForm(Form)">setForm</a>(Form form);</td></tr>
				<tr><td align="right">Form </td><td><a href="#form() const">form</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setSpacing(int)">setSpacing</a>(int spacing);</td></tr>
				<tr><td align="right">int </td><td><a href="#spacing() const">spacing</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#setOrientation(Orientation)">setOrientation</a>(Orientation orientation);</td></tr>
				<tr><td align="right">Orientation </td><td><a href="#orientation() const">orientation</a>() const;</td></tr>
				<tr><td align="right">void </td><td><a href="#addMenu(BMenu*)">addMenu</a>(BMenu* menu);</td></tr>
				<tr><td align="right">BMenu* </td><td><a href="#addMenu(const BString&)">addMenu</a>(const BString&amp; title);</td></tr>
				<tr><td align="right">void </td><td><a href="#insertMenu(int, BMenu*)">insertMenu</a>(int index, BMenu* menu);</td></tr>
				<tr><td align="right">BMenu* </td><td><a href="#insertMenu(int, const BString&)">insertMenu</a>(int index, const BString&amp; title);</td></tr>
				<tr><td align="right">bool </td><td><a href="#removeMenu(BMenu*)">removeMenu</a>(BMenu* menu);</td></tr>
				<tr><td align="right">bool </td><td><a href="#clearMenus()">clearMenus</a>();</td></tr>
				<tr><td align="right">int </td><td><a href="#menuCount() const">menuCount</a>() const;</td></tr>
				<tr><td align="right">BMenu* </td><td><a href="#menu(int)">menu</a>(int index);</td></tr>
				<tr><td align="right">const BMenu* </td><td><a href="#menu(int) const">menu</a>(int index) const;</td></tr>
				<tr><td align="right">bool </td><td><a href="#addSeparator()">addSeparator</a>();</td></tr>
				<tr><td align="right">bool </td><td><a href="#insertSeparator(int)">insertSeparator</a>(int index);</td></tr>
				<tr><td align="right">bool </td><td><a href="#insertSeparator(const BMenu*)">insertSeparator</a>(const BMenu* before);</td></tr>
				<tr><td align="right">bool </td><td><a href="#isSeparator(int)">isSeparator</a>(int index);</td></tr>
				<tr><td align="right">bool </td><td><a href="#removeSeparator(int)">removeSeparator</a>(int index);</td></tr>
				<tr><td align="right">virtual BSize </td><td><a href="#sizeHint() const">sizeHint</a>() const;</td></tr>
			</table>
			<h2>protected</h2>
			<table id="protected">
				<tr><td align="right">virtual void </td><td><a href="#resizeEvent(const BEvent&)">resizeEvent</a>(const BEvent&amp; event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#styleEvent(const BEvent&)">styleEvent</a>(const BEvent&amp; event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#freshEvent(const BEvent&)">freshEvent</a>(const BEvent&amp; event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#paintEvent(const BEvent&)">paintEvent</a>(const BEvent&amp; event);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseEnterEvent(const BMouseEvent&)">mouseEnterEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseLeaveEvent(const BMouseEvent&)">mouseLeaveEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mousePressEvent(const BMouseEvent&)">mousePressEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseReleaseEvent(const BMouseEvent&)">mouseReleaseEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseMoveEvent(const BMouseEvent&)">mouseMoveEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
				<tr><td align="right">virtual void </td><td><a href="#mouseClickEvent(const BMouseEvent&)">mouseClickEvent</a>(const BMouseEvent&amp; mouseEvent);</td></tr>
			</table>
			<div id="desc">
				<h2>详细介绍：</h2>
				<p>BMenuBar是菜单栏控件，用于管理若干菜单项，显示菜单的图标和文本。</p><p>由于菜单默认情况下是隐藏的，使用菜单栏用于显示菜单项，通过点击弹出菜单。</p><p>由于菜单项是标准项设计，所以其样式取决于项样式（:item）的配置。</p><p>添加分割符可使各个菜单项布局更为条理，分割符即为空的菜单项。</p><h3>信号表：</h3><table>
					<tr><td>Signal_OrientationChanged</td><td>当菜单项排布方向改变时发出，值为：Orientation orientation。</td></tr>
					<tr><td>Signal_AlignChanged</td><td>当菜单项的显示的对齐方式改变时发出，值为：Align align。</td></tr>
					<tr><td>Signal_FormChanged</td><td>当菜单项的显示的显示形式改变时发出，值为：Form form。</td></tr>
					<tr><td>Signal_SpacingChanged</td><td>当菜单项的图标与文本之间的间隔改变时发出，值为：Spacing spacing。</td></tr></table>
			</div>
			<h2 id="docs">成员文档：</h2>
			<div id="BMenuBar(BWidget*)">
				<h3>BMenuBar(BWidget* parent = 0);</h3>
				<p>构建一个菜单栏，parent指定其父控件。</p>
			</div>
			<div id="~BMenuBar()">
				<h3>~BMenuBar();</h3>
				<p>析构一个菜单栏，解除与各个菜单控件的信号联接。</p>
			</div>
			<div id="realTips() const">
				<h3>virtual const BString&amp; realTips() const;</h3>
				<p>返回当前被悬停的菜单的实际提示词。</p>
			</div>
			<div id="setAlign(Align)">
				<h3>void setAlign(Align align);</h3>
				<p>设置菜单项的显示对齐方式，实际效果取决于项样式。</p>
			</div>
			<div id="align() const">
				<h3>Align align() const;</h3>
				<p>获得菜单项的显示对齐方式。</p>
			</div>
			<div id="setForm(Form)">
				<h3>void setForm(Form form);</h3>
				<p>设置菜单项的显示形式，实际效果取决于项样式。</p>
			</div>
			<div id="form() const">
				<h3>Form form() const;</h3>
				<p>获得菜单项的显示形式。</p>
			</div>
			<div id="setSpacing(int)">
				<h3>void setSpacing(int spacing);</h3>
				<p>设置菜单项的图标与文本的间隔值。</p>
			</div>
			<div id="spacing() const">
				<h3>int spacing() const;</h3>
				<p>获得菜单项的图标与文本的间隔值。</p>
			</div>
			<div id="setOrientation(Orientation)">
				<h3>void setOrientation(Orientation orientation);</h3>
				<p>设置菜单项的排布方向。</p>
			</div>
			<div id="orientation() const">
				<h3>Orientation orientation() const;</h3>
				<p>获得菜单项的排布方向。</p>
			</div>
			<div id="addMenu(BMenu*)">
				<h3>void addMenu(BMenu* menu);</h3>
				<p>添加添加一个菜单项，连接菜单的若干信号。</p>
			</div>
			<div id="addMenu(const BString&)">
				<h3>BMenu* addMenu(const BString&amp; title);</h3>
				<p>新建一个菜单并添加到此菜单栏，title指定新建的菜单的标题。</p>
			</div>
			<div id="insertMenu(int, BMenu*)">
				<h3>void insertMenu(int index, BMenu* menu);</h3>
				<p>向菜单栏的index位置插入一个菜单，连接菜单的若干信号。</p>
			</div>
			<div id="insertMenu(int, const BString&)">
				<h3>BMenu* insertMenu(int index, const BString&amp; title);</h3>
				<p>新建一个菜单并添加到此菜单栏，title指定新建的菜单的标题。</p>
			</div>
			<div id="removeMenu(BMenu*)">
				<h3>bool removeMenu(BMenu* menu);</h3>
				<p>删除菜单，断开与之的信号连接。</p>
			</div>
			<div id="clearMenus()">
				<h3>bool clearMenus();</h3>
				<p>清空所有菜单项。</p>
			</div>
			<div id="menuCount() const">
				<h3>int menuCount() const;</h3>
				<p>取得菜单的数量。</p>
			</div>
			<div id="menu(int)">
				<h3>BMenu* menu(int index);</h3>
				<p>取得指定索引位置的菜单项。</p>
			</div>
			<div id="menu(int) const">
				<h3>const BMenu* menu(int index) const;</h3>
				<p>取得指定索引位置的菜单项。</p>
			</div>
			<div id="addSeparator()">
				<h3>bool addSeparator();</h3>
			</div>
			<div id="insertSeparator(int)">
				<h3>bool insertSeparator(int index);</h3>
			</div>
			<div id="insertSeparator(const BMenu*)">
				<h3>bool insertSeparator(const BMenu* before);</h3>
			</div>
			<div id="isSeparator(int)">
				<h3>bool isSeparator(int index);</h3>
			</div>
			<div id="removeSeparator(int)">
				<h3>bool removeSeparator(int index);</h3>
			</div>
			<div id="sizeHint() const">
				<h3>virtual BSize sizeHint() const;</h3>
				<p>计算所有需要的合适尺寸。</p>
			</div>
			<div id="resizeEvent(const BEvent&)">
				<h3>virtual void resizeEvent(const BEvent&amp; event);</h3>
				<p>重新调整菜单项的显示布局。</p>
			</div>
			<div id="styleEvent(const BEvent&)">
				<h3>virtual void styleEvent(const BEvent&amp; event);</h3>
				<p>样式取值：</p><table>
					<tr><td>Value_Align</td><td>取值为菜单项的显示对齐方式。</td></tr>
					<tr><td>Value_Form</td><td>取值为菜单项的显示形式。</td></tr>
					<tr><td>Value_Spacing</td><td>取值为菜单项的图标与文本的间隔。</td></tr>
					<tr><td>Value_Orientation</td><td>取值为菜单顶的布局方式。</td></tr></table><p>附件样式（:separator）</p><table>
					<tr><td>Value_Width</td><td>取值为分隔符的宽度。</td></tr>
					<tr><td>Value_Height</td><td>取值为分隔符的高度。</td></tr>
					<tr><td>Value_Image</td><td>取值为分隔符的图像。</td></tr></table>
			</div>
			<div id="freshEvent(const BEvent&)">
				<h3>virtual void freshEvent(const BEvent&amp; event);</h3>
				<p>需要时重新菜单项的显示布局。</p>
			</div>
			<div id="paintEvent(const BEvent&)">
				<h3>virtual void paintEvent(const BEvent&amp; event);</h3>
				<p>绘制所有菜单项。</p>
			</div>
			<div id="mouseEnterEvent(const BMouseEvent&)">
				<h3>virtual void mouseEnterEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>更新菜单项的悬停状态。</p>
			</div>
			<div id="mouseLeaveEvent(const BMouseEvent&)">
				<h3>virtual void mouseLeaveEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>更新菜单项的悬停状态。</p>
			</div>
			<div id="mousePressEvent(const BMouseEvent&)">
				<h3>virtual void mousePressEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>更新鼠标左键按下的状态。</p>
			</div>
			<div id="mouseReleaseEvent(const BMouseEvent&)">
				<h3>virtual void mouseReleaseEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>更新鼠标左键按下的状态。</p>
			</div>
			<div id="mouseMoveEvent(const BMouseEvent&)">
				<h3>virtual void mouseMoveEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>更新菜单项的悬停状态。</p>
			</div>
			<div id="mouseClickEvent(const BMouseEvent&)">
				<h3>virtual void mouseClickEvent(const BMouseEvent&amp; mouseEvent);</h3>
				<p>菜单项被点击后弹出对应的菜单控件。</p>
			</div>
		</div>
	</body>
</html>